/**
 * 
 */
package com.zhanggz.mypattern.cor.handler;

/**
 * 销售人员，可以批准5％以内的折扣
 * 
 * @author alex
 * @Date Jun 23, 2015
 */
public class Sales extends PriceHandler {

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.zhanggz.mypattern.cor.PriceHandler#processDiscount(float)
	 */
	@Override
	public void processDiscount(float discount) {
		if (discount <= 0.05) {
			System.out.format("%s批准了折扣：%.2f%n", this.getClass().getName(),
					discount);
		} else {
			// 传递给上一级
			successor.processDiscount(discount);
		}

	}

}
